<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="include/base.jsp" %>
<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<title>凯盛项目管理系统</title>
	<link rel="shortcut icon" href="../img/favicon.ico" >
	<link rel="stylesheet" href="../css/bootstrap.min.css">
	<link rel="stylesheet" href="../css/jquery.atwho.css">
	<link rel="stylesheet" href="../css/bootstrap-responsive.css">
	<link rel="stylesheet" href="../css/docs.css">
	<style type="text/css">
		body{
			background:url(../img/b.png);
			
		}
		
	</style>
</head>
<body class="body">
	<% pageContext.setAttribute("left", "new"); %>
	<%@ include file="include/top.jsp" %>
	
	
	<div class="container" style="background: url(../img/c.png) repeat-y 970px 0;">
	  <div class="row">
		<%@ include file="include/left.jsp" %>
		<div class="span7" style="margin-top:10px;border-left:1px solid #ccc">
		  
		 
		 
		 
		 <h1 style="color:#ff7400;margin-bottom:20px;margin-left:15px;">帖子详细：</h1>
		 
		 
		 
			
			<div id="test" style="border-left:1px #ccc solid;border-right:1px #ccc solid;border-top:3px solid #ccc;">
			
			
			
					
						<div class="media" style="margin-top:10px;border-top:1px #0088cc solid;">
						
						
						
						
						
							<a class="pull-left" href="javascript:;" style="margin-left:10px;margin-right:10px;margin-top:10px;">
			                <img class="media-object" data-src="holder.js/64x64" alt="64x64" style="width: 64px; height: 64px;" src="showimg.img?n=${newState.createuser.pic }">
			              </a>
			              <div class="media-body">
			                <h3 class="media-heading" style="margin-left:100px;">${newState.createuser.username }</h3>
			                 <span style="margin-left:10px;">${newState.content }</span>
			              </div>
			              <div style="float:right;margin-right:20px;">
			              	<a style="margin-right:40px;color:#ff7400" href="javascript:;" title="${newState.createtime }">${newState.time }</a>
			              	<a href="javascript:0;" id="mya${newState.id }">评论</a>
			              </div>
			              
			              <div style="clear:both;">
			            	
			            </div>
			            <!-- huifu -->
			            
			              <form action="savereplay.jspx" method="post" id="f${newState.id }" style="float:right;margin-right:10px;margin-top:10px;display:none">
			              		对楼主的回复：<input autocomplete="off" type="text"class="span3 atwho" id="replay${newState.id }" name="huifucontent"><br/>
			              		<input type="hidden" value="${newState.id }" name="huifufid" >
			              		<input type="hidden" value="${newState.createuser.id }" name="replaywhoid">
			              		<button type="submit" class="btn-success" style="float:right;margin-right:20px;" id="sub${newState.id }">回复</button>
			              		<a href="javascript:;" style="float:right;margin-right:20px;" id="quxiao${newState.id }">取消</a>
			              </form>
						
			              
			              
			              
			              <!-- gentie -->
			              <c:forEach items="${replaylist }" var="v">
			              
			              	  <div style="margin-left:290px;background-color:#e6e6e6;border:1px #ffffff solid;">
			              	  	
				              		<img alt="" src="showimg.img?n=${v.createuser.pic }" style="width:30px;height:30px;margin-top:10px;margin-left:10px;">
				              		<div style="width:300px;float:right;margin-right:10px;margin-top:10px;">
				              			<a href="javascript:;">${v.createuser.username }</a>&nbsp;回复&nbsp;<a href="javascript:;">${v.replaywho.username }</a>：${v.content }　　(<span style="width:30px;color:red;">${v.time }</span>)<br/>
				              			<a href="javascript:;" style="margin-left:200px;" id="r${v.id }">回复</a>
				              		</div>
				              		
				              		<!-- huifu2 -->
				              		<form action="savereplay.jspx" method="post" id="re${v.id }" style="float:right;margin-right:10px;margin-top:10px;display:none;">
						              		对<a href="javascript:;">${v.createuser.username }</a>回复：<input autocomplete="off" type="text"class="span3 atwho" id="replay${s.id }" name="huifucontent"><br/>
						              		<input type="hidden" value="${newState.id }" name="huifufid">
						              		<input type="hidden" value="${v.createuser.id }" name="replaywhoid">
						              		<button type="submit" class="btn-success" style="float:right;margin-right:20px;" id="sub${newState.id }">回复</button>
						              		<a href="javascript:;" style="float:right;margin-right:20px;" id="quxiao${v.id }">取消</a>
						              </form>
				              		<a href="javascript:;" style="margin-left:320px;"></a>
				              		
				              		 
				              </div>
			              	
			              </c:forEach>
			             
			              
			            </div>
			            <div style="clear:both;">
			            	
			            </div>
					
						
				
			</div>
			
			<div style="margin-top:30px;"></div>
            
            
            
            <div style="margin-buttom:70px;">
            	
            </div>
            
            
            


		</div>
		<!-- right -->
		<%@ include file="include/right.jsp" %>
	  </div>
	</div>
	
	
	
	
	<script type="text/javascript" src="../js/jquery.atwho.min.js"></script>
	<script type="text/javascript" src="../js/at.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			
			
			
			
			
			/*
				这边作评论的显示用得。。。。
			*/
			
			
			
			
					$("#mya${newState.id}").click(function(){
						$("#f${newState.id}").show();
					});
			
					$("#quxiao${newState.id}").click(function(){
						$("#f${newState.id}").hide();
					});
			
					
					
					<c:forEach items="${replaylist }" var="v">
						$("#r${v.id}").click(function(){
							$("#re${v.id}").show();
						});
						$("#quxiao${v.id}").click(function(){
							$("#re${v.id}").hide();
						});
					
					</c:forEach>
					
			
		
			
			
			$("#area").blur(function(){
				var text = $("#area").val();
				if(text.length < 140){
					if(text.length == 0){
						$("#hide").show();
						$("#btn").hide();
					}else{
						$("#hide").hide();
						$("#btn").show();
					}
					
					$("#show").show();
					$("#show2").hide();
					$("#number").html(140-text.length);
				}else{
					$("#btn").hide();
					$("#hide").show();
					$("#show2").show();
					$("#show").hide();
					$("#chao").html(text.length - 140);
				}
			});
			$("#area").keyup(function(){
				var text = $("#area").val();
				
				if(text.length < 140){
					if(text.length == 0){
						$("#hide").show();
						$("#btn").hide();
					}else{
						$("#hide").hide();
						$("#btn").show();
					}
					$("#show").show();
					$("#show2").hide();
					$("#number").html(140-text.length);
				}else{
					$("#btn").hide();
					$("#hide").show();
					$("#show2").show();
					$("#show").hide();
					$("#chao").html(text.length - 140);
				}
				
				
			});
			
			
			
			//at的功能
			
			var names = new Array(); 
			var i = 0;
			<c:forEach items="${userlist }" var="v">
				names[i] = "${v.username}";
				i++;
			 </c:forEach>
			 
			 
			var names = $.map(names,function(value,i) {
			    return {'id':i,'name':value,'email':" "};
			});
			
			$(".atwho").atwho('@', {
			    data: names,
			    limit:5
			});
			
		});
	</script>
</body>
</html>